package com.content_module.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.content_module.R;

import component.fy.com.common_module.baseAdapter.BaseRecyclerAdapter;
import component.fy.com.common_module.baseAdapter.BaseViewHolder;
import component.fy.com.common_module.utils.GlideUtils;
import component.fy.com.common_module.utils.MyUtil;

public class SnapHelperAdapter extends BaseRecyclerAdapter<String> {

    public SnapHelperAdapter(Context context, int layoutId) {
        super(context, layoutId);
    }

    @Override
    public void onBind(BaseViewHolder holder, @Nullable String bean, int position) {
        RelativeLayout layout = holder.getView(R.id.content_item_image_only_layout);
        ImageView imageView = holder.getView(R.id.content_item_image_only_img);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((int) (MyUtil.getScreenWidth(getContext()) * 0.8), RelativeLayout.LayoutParams.WRAP_CONTENT);
        layout.setLayoutParams(params);
        GlideUtils.setImageNormal(getContext(), bean, imageView);
    }
}
